//
//  NSString+URL.m
//  TutorialProject
//
//  Created by Ondrej Rafaj on 4.2.10.
//  Copyright 2010 Home. All rights reserved.
//

#import "NSString+URL.h"


@implementation NSString (urlTools)

+ (NSString *)stringWithContentsOfUrlInUtf8:(NSString *)targetUrl {
	NSLog(@"URL in String: %@", targetUrl);
	NSURL *location = [NSURL URLWithString:targetUrl];
    NSError *error = nil;
	NSString *content = [NSString stringWithContentsOfURL:location encoding:NSUTF8StringEncoding error:&error];
	if (error) NSLog(@"Something went wrong %d, %@", [error code], [error localizedDescription]);
	return content;	
}

@end
